import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import Home from './components/tabbar/Home.vue'
import Memder from './components/tabbar/Memder.vue'
import Search from './components/tabbar/Search.vue'
import Shopcar from './components/tabbar/Shopcar.vue'
import NewsList from './components/news/NewsList.vue'
import NewsInfo from './components/news/NewsInfo.vue'
import Photolist from './components/photos/Photolist.vue'

// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    { path: '/', redirect:'/home' }, 
    { path: '/home',component: Home },
    { path: '/memder',component: Memder },
    { path: '/search',component: Search },
    { path: '/shopcar',component: Shopcar },
    { path: '/home/newslist',component:NewsList },
    { path: '/home/newsinfo/:id',component:NewsInfo },
    { path: '/home/photolist', component:Photolist }
  ],
  linkActiveClass: 'mui-active'
})

// 把路由对象暴露出去
export default router